package com.ruizhong.PIW.controller;

import com.ruizhong.PIW.entity.TColumn;
import com.ruizhong.PIW.service.TableColumnService;
import com.ruizhong.PIW.utils.Result;
import com.ruizhong.PIW.utils.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/api/table")
@CrossOrigin
public class TableColumnController {
    @Autowired
    private TableColumnService tableColumnService;

    @GetMapping("/getColumn/{tableId}")
    public Result getColumn(@PathVariable Integer tableId) {
        List<TColumn> column = tableColumnService.getColumn(tableId);
        return new Result(ResultCode.success,null,column);
    }
}
